package com.designpattern.sixchapter.remotecontrol;

import com.designpattern.sixchapter.first.Light;
import com.designpattern.sixchapter.first.LightOnCommand;

public class RemoteLoad {
	
	
	public static void main(String[] args) {
		
		RemoteControl remoteControl = new RemoteControl();
		Light livingRoomLight = new Light("livingRoom");
		Light kitchenLight = new Light("kitchen");
		
		Stereo stereo = new Stereo();
		
		
		LightOnCommand  livingRoomLightOnCommand = new LightOnCommand(livingRoomLight);
		LightOffCommand  livingRoomLightOffCommand = new LightOffCommand(livingRoomLight);
		LightOnCommand  kitchenLightOnCommand = new LightOnCommand(kitchenLight);
		LightOffCommand  kitchenLightOffCommand = new LightOffCommand(kitchenLight);
		
		StereoOnWithCDCommand stereoOnWithCDCommand = new StereoOnWithCDCommand(stereo);
		StereoOffCommand stereoOffCommand = new StereoOffCommand(stereo);
		
		remoteControl.setCommand(0, livingRoomLightOnCommand, livingRoomLightOffCommand);
		remoteControl.setCommand(1, kitchenLightOnCommand, kitchenLightOffCommand);
		
		
		remoteControl.setCommand(2, stereoOnWithCDCommand, stereoOffCommand);
		System.out.println(remoteControl.toString());
		
		
		remoteControl.onBtnWasPushed(0);
		remoteControl.offBtnWasPushed(0);
		
		remoteControl.onBtnWasPushed(1);
		remoteControl.offBtnWasPushed(1);
		
		remoteControl.onBtnWasPushed(2);
		remoteControl.offBtnWasPushed(2);
		
	}

}
